def next_one(num: int) -> int:
    return num // 2 if num % 2 == 0 else 3 * num + 1


def iterate_items(start: int) -> int:
    count = 0
    while start != 1:
        count += 1
        start = next_one(start)
    return count + 1


if __name__ == '__main__':
    max_count = 10
    number = 13
    challenge = 14
    while challenge < 1000000:
        t = iterate_items(challenge)
        if t > max_count:
            number = challenge
            max_count = t
        challenge += 1
        if challenge % 100000 == 0:
            print(challenge)
    print('------')
    print(max_count, number)
